<?php if(isset($items)): ?>
	<?php
		$user = $items['user'];
		$points = $items['points'];

		$user_picture_url = '';
		$user_display_name = '';
		$user_email = '';
		
		//get the user image html
		if(isset($user->picture) && !empty($user->picture->fid)) {
			$user_picture = array(
            'style_name' => 'medium',
            'path' => $user->picture->uri,
            );


			$user_picture_html = theme('image_style', $user_picture);

		}
		else if(variable_get('user_picture_default', '')) {
			$default_user_picture = (variable_get('user_picture_default', ''));
			$file = basename($default_user_picture);

			$default_user_picture_uri = file_build_uri($file);

			$user_picture = array(
            'style_name' => 'medium',
            'path' => $default_user_picture_uri,
            );

			$user_picture_html = theme('image_style', $user_picture);
		}

		//get the user display name
		if(isset($user->field_display_username['und']) && !empty($user->field_display_username['und'][0]['value'])) {
			$user_display_name = $user->field_display_username['und'][0]['value'];
		}

		//get the user email
		if(isset($user->mail) && !empty($user->mail)) {
			$user_email = $user->mail;
		}

	?>

	<div class="member-info-wrapper">
		<div class="member-info-row">
			<div class="member-section">
				<div class="user-picture">
					<?php if(!empty($user_picture_html)):?>
						<div class="user-image"><?php print $user_picture_html; ?></div>
					<?php endif; ?>
				</div>
				<div class="user-info">
					<?php if(!empty($user_email)):?>
						<p>JClub會員帳戶：</p>
						<p class="user-email"><?php print $user_email; ?></p>
					<?php endif; ?>
					
				</div>
			</div>
			<div class="userpoint-section">
				<p>JesPOINT積分總數：</p>
				<p><?php print $points; ?>分</p>
			</div>

		</div>
	</div>
<?php endif; ?>